#!/bin/bash

problems=(
    "0-1 背包问题"
     "完全背包问题"
     "⼦集背包问题"

)

for prob in "${problems[@]}"; do
    num=$(echo $prob | grep -oE '^[0-9]+')
    title=$(echo $prob | sed "s/$num//g" | xargs)
    # 移除标题中的点号
    title=${title//./}
    filename="LC_${num}_${title// /_}.java"
    cat > $filename <<EOF
package org.labuladong.暴力搜索算法.回溯算法;

/**
 * @Author: qingle
 * @Date: 2024/10/28-16:11
 * @Description: $prob
 * @version: 1.0
 */
public class LC_${num}_${title// /_} {
}
EOF
done